<template>
	<view class="body">
		<view class='title'>
			好友列表
		</view>
		<view class="li" v-for="(item,index) in juniorList" :key="index">
			<image class="img" :src="item.avatar ? item.avatar :'../../static/image/df_aravat.png'" mode="aspectFill">
				<view class="name">
					{{item.nickName}}
				</view>
		</view>
		<view class="none" v-if="juniorList.length<= 0 ">
			暂无好友
		</view>
	</view>
</template>

<script>
	import {
		getJunior
	} from '@/api.js'
	export default {
		data() {
			return {
				juniorList: []
			}
		},
		onLoad() {
			this.getlist()
		},
		methods: {
			async getlist() {
				let res = await getJunior()
				this.juniorList = res
			},
		}
	}
</script>

<style lang="scss" scoped>
	.body {
		background: #f8f8f8;
		height: 100vh;
		width: 100vw;
		padding: 30rpx 0;
		box-sizing: border-box;

		.none {
			width: 750rpx;
			text-align: center;
			margin-top: 200rpx;
		}
	}

	.title {
		width: 100vw;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;

	}

	.li {
		background: #fff;
		width: 710rpx;
		margin: 20rpx auto;
		box-sizing: border-box;
		padding: 20rpx 40rpx;
		border-radius: 20rpx;
		height: 140rpx;
		line-height: 140rpx;
		display: flex;
		align-items: center;

		.img {
			width: 100rpx;
			height: 100rpx;
			border-radius: 50rpx;
		}

		.name {
			margin-left: 100rpx;
		}


	}
</style>